import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType'

export default [
  {
    path: '/page',
    component: Layout,
    // name: 'page',
    meta: { title: '页面管理', icon: 'el-icon-s-help' },
    children: [
      {
        path: 'icon',
        component: () => import('@/feature/page/app/icon/index'),
        meta: { title: '图标管理', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('page:icon').oo()
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建快捷方式',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      },
      {
        path: 'list-info',
        // name: 'list-info',
        component: () => import('@/feature/page/app/info/index'),
        meta: { title: '页面列表', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('page:list-info')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            }])
          .build()
      },
      {
        path: 'project',
        component: () => import('@/feature/page/app/project/index'),
        meta: { title: '百千万工程', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('page:project')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建百千万工程',
              icon: 'el-icon-plus'
            }, {
              handler: 'spotManager',
              name: 'mj:project-spot:list',
              type: TableButtonType.ROW,
              label: '景点管理',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            },
            {
              handler: 'list',
              name: 'list',
              groupId: 2,
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              groupId: 2,
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              groupId: 2,
              type: TableButtonType.TOOLBAR,
              label: '新建百千万工程景点',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              groupId: 2,
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              groupId: 2,
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      }
    ]
  }
]
